<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="./pages/styles/style2.css" />
<title>Recomand to Jobs</title>
<body>
	<jsp:directive.include file="Header.jsp" />
	<jsp:directive.include file="Navigation.jsp" />
	<div class="content">
		<div class="content-header">
			<h1>
				Recomand Candidate to jobs <img src="./pages/images/logo.png"
					align="right" width="130" height="40">
			</h1>
		</div>
		<div class="content-tag">
			<h1>Candidate</h1>
			<h2>${candidate.firstName}${candidate.lastName}</h2>
			<ul>
				<li><label>Phone number:</label> ${candidate.phoneNumber }</li>
				<li><label>Mobile number:</label> ${candidate.mobileNumber }</li>
				<li><label>E-Mail:</label> ${candidate.mail }</li>
				<li><label>Address:</label> ${candidate.address }</li>
				<li><label>Relocation:</label> ${candidate.relocation }</li>
			</ul>
		</div>
		<c:choose>
			<c:when test="${empty jobList}">
				<div class="content-tag">
					<h3>No available jobs or this candidate already hired or
						recommended!</h3>
				</div>
			</c:when>
			<c:otherwise>
				<c:forEach var="job" items="${jobList}">
					<c:if test="${job.opened and job.approved }">
						<form action="./RecommendToJob" method="post">
							<div class="content-tag">
								<div class="content-tag-header">
									<table>
										<tr>
											<td>
												<h2>${job.title}</h2>
											</td>
											<c:if test="${role == 'general' or role == 'recruiter' }">
												<td><input type="hidden" name="jobId" 
													value="${job.id }"><input class="button" type="submit"
													name="recommend" value="Recommend for tihs Job"></td>
											</c:if>
										</tr>
									</table>
								</div>
								<ul>
									<li><label>Title:</label> ${job.title}</li>
									<li><label>Number of candidates:</label>
										${job.maxCandidates }</li>
									<li><label>Owner:</label> ${job.proposer.firstName }
										${job.proposer.lastName }</li>
									<li><label>Opened:</label> ${job.opened }</li>
									<li><h3>Description</h3>
										<ul>
											<li><label>Department:</label>
												${job.description.department.name }</li>
											<li><label>Project:</label> ${job.description.project }</li>
											<li><label>Requirements:</label>
												${job.description.requirements }</li>
											<li><label>Responsabilities:</label>
												${job.description.responsabilities }</li>
										</ul></li>
									<li><h3>Comments</h3> <c:choose>
											<c:when test="${empty job.comments }">
												<div class="comment-tag">
													<h4>No comments</h4>
												</div>
											</c:when>
											<c:otherwise>
												<c:forEach var="comment" items="${job.comments}">
													<div class="comment-tag">
														<ul>
															<li><label>Date:</label> ${comment.date }</li>
															<li><label>User:</label> ${comment.user.firstName }
																${comment.user.lastName }</li>
															<li><label>Text:</label> ${comment.content }</li>
														</ul>
													</div>
												</c:forEach>
											</c:otherwise>
										</c:choose></li>

								</ul>
							</div>
						</form>
					</c:if>
				</c:forEach>
			</c:otherwise>
		</c:choose>
	</div>

</body>
</html>